home *** CD-ROM | disk | FTP | other *** search
- on SetWindow1 Fenetre, Mode
- global gHighLightPos, gCurrentPos, gNbItem, gTermList, gPicList
- set HighL to getAt(gHighLightPos, Fenetre)
- set CurrentP to getAt(gCurrentPos, Fenetre)
- set NbElement to getAt(gNbItem, Fenetre)
- set ajustement to (Fenetre - 1) * 7
- set Sp1 to 10 + ajustement
- set Sp2 to 11 + ajustement
- set Sp3 to 12 + ajustement
- set Sp4 to 13 + ajustement
- set Sp5 to 14 + ajustement
- set Sp6 to 15 + ajustement
- if Fenetre = 1 then
- set Fld1 to 10096
- else
- if Fenetre = 2 then
- set Fld1 to 10097
- if NbElement > 6 then
- set the visible of sprite Sp4 to 1
- set the visible of sprite 45 to 0
- else
- set the visible of sprite Sp4 to 0
- set the visible of sprite 45 to 1
- end if
- else
- set Fld1 to 10098
- if NbElement > 6 then
- set the visible of sprite Sp4 to 1
- set the visible of sprite 46 to 0
- else
- set the visible of sprite Sp4 to 0
- set the visible of sprite 46 to 1
- end if
- end if
- end if
- if Mode = 1 then
- set HighL to 0
- set the visible of sprite Sp2 to 0
- if Fenetre = 1 then
- setAt(gHighLightPos, 2, 0)
- set the visible of sprite (Sp2 + 7) to 0
- put " " into field 10097
- setAt(gNbItem, 2, 0)
- setAt(gHighLightPos, 3, 0)
- set the visible of sprite (Sp2 + 14) to 0
- put " " into field 10098
- setAt(gNbItem, 3, 0)
- else
- if Fenetre = 2 then
- setAt(gHighLightPos, 3, 0)
- set the visible of sprite (Sp2 + 7) to 0
- put " " into field 10098
- setAt(gNbItem, 3, 0)
- else
- if Fenetre = 3 then
- set the visible of sprite Sp4 to 0
- end if
- end if
- end if
- else
- if Mode = 2 then
- if HighL < 2 then
- set CurrentP to 1
- else
- if HighL > (NbElement - 4) then
- set CurrentP to max(NbElement - 5, 1)
- else
- set CurrentP to HighL - 1
- end if
- end if
- if Fenetre = 1 then
- set ListResult to FindWordP(CurrentP, 1) & numToChar(13) & FindWordP(CurrentP + 1, 1) & numToChar(13) & FindWordP(CurrentP + 2, 1) & numToChar(13) & FindWordP(CurrentP + 3, 1) & numToChar(13) & FindWordP(CurrentP + 4, 1) & numToChar(13) & FindWordP(CurrentP + 5, 1)
- set Search to FindWordP(HighL, 1)
- else
- if Fenetre = 2 then
- set ListResult to EMPTY
- repeat with i = 0 to min(5, NbElement - 1)
- set ListResult to ListResult & getAt(gTermList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- set Search to getAt(gTermList, HighL)
- else
- if Fenetre = 3 then
- set ListResult to EMPTY
- repeat with i = 0 to min(5, NbElement - 1)
- set ListResult to ListResult & getAt(gPicList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- set Search to getAt(gPicList, HighL)
- end if
- end if
- end if
- if (line 1 of ListResult = Search) and (CurrentP = 1) then
- set HighL to CurrentP
- else
- if (CurrentP + 5) = NbElement then
- if line 2 of ListResult >= Search then
- set HighL to CurrentP + 1
- else
- if line 3 of ListResult >= Search then
- set HighL to CurrentP + 2
- else
- if line 4 of ListResult >= Search then
- set HighL to CurrentP + 3
- else
- if line 5 of ListResult >= Search then
- set HighL to CurrentP + 4
- else
- if line 6 of ListResult >= Search then
- set HighL to CurrentP + 5
- end if
- end if
- end if
- end if
- end if
- else
- set HighL to CurrentP + 1
- end if
- end if
- put ListResult into field Fld1
- UpdateCursor(Fenetre, CurrentP)
- set the locV of sprite Sp2 to ((HighL - CurrentP) * 12) + SpriteTop(Sp1) + 1
- set the visible of sprite Sp2 to 1
- else
- if Mode = 3 then
- if Fenetre = 1 then
- set ListResult to FindWordP(CurrentP, 1) & numToChar(13) & FindWordP(CurrentP + 1, 1) & numToChar(13) & FindWordP(CurrentP + 2, 1) & numToChar(13) & FindWordP(CurrentP + 3, 1) & numToChar(13) & FindWordP(CurrentP + 4, 1) & numToChar(13) & FindWordP(CurrentP + 5, 1)
- else
- if Fenetre = 2 then
- set ListResult to EMPTY
- repeat with i = 0 to min(NbElement - 1, 5)
- set ListResult to ListResult & getAt(gTermList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- else
- set ListResult to EMPTY
- repeat with i = 0 to min(NbElement - 1, 5)
- set ListResult to ListResult & getAt(gPicList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- end if
- end if
- put ListResult into field Fld1
- set LineNum to HighL - CurrentP + 1
- if (HighL <> 0) and (LineNum <= 6) and (LineNum > 0) then
- set the locV of sprite Sp2 to ((LineNum - 1) * 12) + SpriteTop(Sp1) + 1
- set the visible of sprite Sp2 to 1
- else
- if the visible of sprite Sp2 = 1 then
- set the visible of sprite Sp2 to 0
- end if
- end if
- UpdateCursor(Fenetre, CurrentP)
- else
- if Mode = 4 then
- set LineNum to HighL - CurrentP + 1
- if not ((LineNum <= 6) and (LineNum > 0)) or (HighL = 0) then
- if HighL = 0 then
- set HighL to CurrentP
- if Fenetre = 1 then
- FindTerms(HighL)
- setAt(gCurrentPos, 2, 1)
- setAt(gHighLightPos, 2, 0)
- SetWindow1(2, 3)
- else
- if Fenetre = 2 then
- FindPics(HighL)
- setAt(gCurrentPos, 3, 1)
- setAt(gHighLightPos, 3, 0)
- SetWindow1(3, 3)
- end if
- end if
- else
- if HighL > (NbElement - 5) then
- set CurrentP to max(NbElement - 5, 1)
- else
- set CurrentP to HighL
- end if
- end if
- if Fenetre = 1 then
- set ListResult to FindWordP(CurrentP, 1) & numToChar(13) & FindWordP(CurrentP + 1, 1) & numToChar(13) & FindWordP(CurrentP + 2, 1) & numToChar(13) & FindWordP(CurrentP + 3, 1) & numToChar(13) & FindWordP(CurrentP + 4, 1) & numToChar(13) & FindWordP(CurrentP + 5, 1)
- set the text of cast 10095 to FindWordP(HighL, 0)
- else
- if Fenetre = 2 then
- set ListResult to EMPTY
- repeat with i = 0 to min(5, NbElement - 1)
- set ListResult to ListResult & getAt(gTermList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- else
- set ListResult to EMPTY
- repeat with i = 0 to min(5, NbElement - 1)
- set ListResult to ListResult & getAt(gPicList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- end if
- end if
- put ListResult into field Fld1
- UpdateCursor(Fenetre, CurrentP)
- set the locV of sprite Sp2 to ((HighL - CurrentP) * 12) + SpriteTop(Sp1) + 1
- if the visible of sprite Sp2 = 0 then
- set the visible of sprite Sp2 to 1
- end if
- end if
- else
- if (Mode = 5) and not ((HighL = 1) and (CurrentP = 1)) then
- if HighL = 0 then
- set HighL to CurrentP
- else
- set LineNum to HighL - CurrentP + 1
- if (LineNum <= min(6, NbElement)) and (LineNum > 1) then
- set HighL to HighL - 1
- else
- if LineNum = 1 then
- if Fenetre = 1 then
- set ListResult to the text of field Fld1
- delete line 6 of ListResult
- set CurrentP to CurrentP - 1
- set TempWord to FindWordP(CurrentP, 1) & numToChar(13)
- put TempWord before line 1 of ListResult
- else
- if Fenetre = 2 then
- set ListResult to the text of field Fld1
- delete line 6 of ListResult
- set CurrentP to CurrentP - 1
- set TempWord to getAt(gTermList, CurrentP) & numToChar(13)
- put TempWord before line 1 of ListResult
- else
- set ListResult to the text of field Fld1
- delete line 6 of ListResult
- set CurrentP to CurrentP - 1
- set TempWord to getAt(gPicList, CurrentP) & numToChar(13)
- put TempWord before line 1 of ListResult
- end if
- end if
- else
- if HighL = 1 then
- set CurrentP to 1
- set HighL to 2
- else
- if HighL > (NbElement - 5) then
- set CurrentP to NbElement - 5
- else
- set CurrentP to HighL - 1
- end if
- end if
- if Fenetre = 1 then
- set ListResult to FindWordP(CurrentP, 1) & numToChar(13) & FindWordP(CurrentP + 1, 1) & numToChar(13) & FindWordP(CurrentP + 2, 1) & numToChar(13) & FindWordP(CurrentP + 3, 1) & numToChar(13) & FindWordP(CurrentP + 4, 1) & numToChar(13) & FindWordP(CurrentP + 5, 1)
- else
- if Fenetre = 2 then
- set ListResult to EMPTY
- repeat with i = 0 to 5
- set ListResult to ListResult & getAt(gTermList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- else
- set ListResult to EMPTY
- repeat with i = 0 to 5
- set ListResult to ListResult & getAt(gPicList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- end if
- end if
- end if
- set HighL to max(HighL - 1, 1)
- put ListResult into field Fld1
- UpdateCursor(Fenetre, CurrentP)
- end if
- end if
- set the locV of sprite Sp2 to ((HighL - CurrentP) * 12) + SpriteTop(Sp1) + 1
- if the visible of sprite Sp2 = 0 then
- set the visible of sprite Sp2 to 1
- end if
- if Fenetre = 1 then
- set ListResult to the text of field Fld1
- put FindWordP(HighL, 0) into field 10095
- set the selEnd to the length of line 1 of the text of cast 10095
- set the selStart to the selEnd
- set the foreColor of cast 10095 to 14
- end if
- else
- if (Mode = 6) and not ((HighL = NbElement) and (CurrentP = (NbElement - min(NbElement - 1, 5)))) then
- if HighL = 0 then
- set HighL to CurrentP
- else
- set LineNum to HighL - CurrentP + 1
- if (LineNum <= min(NbElement - 1, 5)) and (LineNum > 0) then
- set HighL to HighL + 1
- else
- if LineNum = 6 then
- if Fenetre = 1 then
- set ListResult to the text of field Fld1
- delete line 1 of ListResult
- set CurrentP to CurrentP + 1
- set TempWord to numToChar(13) & FindWordP(CurrentP + 5, 1)
- put TempWord after ListResult
- else
- if Fenetre = 2 then
- set ListResult to the text of field Fld1
- delete line 1 of ListResult
- set CurrentP to CurrentP + 1
- set TempWord to numToChar(13) & getAt(gTermList, CurrentP + 5)
- put TempWord after ListResult
- else
- set ListResult to the text of field Fld1
- delete line 1 of ListResult
- set CurrentP to CurrentP + 1
- set TempWord to numToChar(13) & getAt(gPicList, CurrentP + 5)
- put TempWord after ListResult
- end if
- end if
- else
- if HighL < 6 then
- set CurrentP to 1
- else
- if HighL > (NbElement - 5) then
- set CurrentP to NbElement - 5
- else
- set CurrentP to HighL - 4
- end if
- end if
- if Fenetre = 1 then
- set ListResult to FindWordP(CurrentP, 1) & numToChar(13) & FindWordP(CurrentP + 1, 1) & numToChar(13) & FindWordP(CurrentP + 2, 1) & numToChar(13) & FindWordP(CurrentP + 3, 1) & numToChar(13) & FindWordP(CurrentP + 4, 1) & numToChar(13) & FindWordP(CurrentP + 5, 1)
- else
- if Fenetre = 2 then
- set ListResult to EMPTY
- repeat with i = 0 to 5
- set ListResult to ListResult & getAt(gTermList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- else
- set ListResult to EMPTY
- repeat with i = 0 to 5
- set ListResult to ListResult & getAt(gPicList, CurrentP + i) & numToChar(13)
- end repeat
- delete char -30003 of ListResult
- end if
- end if
- end if
- set HighL to min(HighL + 1, NbElement)
- put ListResult into field Fld1
- UpdateCursor(Fenetre, CurrentP)
- end if
- end if
- set the locV of sprite Sp2 to ((HighL - CurrentP) * 12) + SpriteTop(Sp1) + 1
- if the visible of sprite Sp2 = 0 then
- set the visible of sprite Sp2 to 1
- end if
- if Fenetre = 1 then
- set ListResult to the text of field Fld1
- put FindWordP(HighL, 0) into field 10095
- set the selEnd to the length of line 1 of the text of cast 10095
- set the selStart to the selEnd
- set the foreColor of cast 10095 to 14
- end if
- end if
- end if
- end if
- end if
- end if
- end if
- setAt(gCurrentPos, Fenetre, CurrentP)
- setAt(gHighLightPos, Fenetre, HighL)
- updateStage()
- end
-